/*************************************************************************
	> File Name: 003.求解范围内所有数字的最大素因子.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 一  8/23 17:09:49 2021
 ************************************************************************/

#include <stdio.h>

#define MAX_N 100

int prime[MAX_N + 5];

void solve() {
    for (int i = 2; i <= MAX_N; i++) {
        if (prime[i]) continue;
        for (int j = i; j <= MAX_N; j += i) {
            prime[j] = i;
        }
    }
}

int main() {
    solve();
    for (int i = 2; i <= MAX_N; i++) {
        printf("max_factor(%d) = %d\n", i, prime[i]);
    }
    return 0;
}
